package com.ts.api.module.api.entity.bo;

import com.ts.api.module.api.entity.po.ApiKeyPO;
import com.ts.api.module.channel.entity.po.ChannelPO;
import lombok.Data;

/**
 *  检测历史用户业务实体
 *
 *  @author Pan
 */
@Data
public class ApiCheckHistoryUserBO {

    /** API客户端 */
    private ApiKeyPO apiKeyPO;
    /** 渠道客户端 */
    private ChannelPO channelPO;
    /** 用户手机号md5 */
    private String phoneMd5;
    /** 手机号掩码 */
    private String phoneMask;

    public ApiCheckHistoryUserBO(ChannelPO channelPO) {
        this.channelPO = channelPO;
    }

    public ApiCheckHistoryUserBO(ApiKeyPO apiKeyPO) {
        this.apiKeyPO = apiKeyPO;
    }

    public ApiCheckHistoryUserBO(ApiKeyPO apiKeyPO, String phoneMd5) {
        this.apiKeyPO = apiKeyPO;
        this.phoneMd5 = phoneMd5;
    }

    public ApiCheckHistoryUserBO(ChannelPO channelPO, String phoneMd5) {
        this.channelPO = channelPO;
        this.phoneMd5 = phoneMd5;
    }

    public static ApiCheckHistoryUserBO createApiKeyByMd5(ApiKeyPO apiKeyPO, String phoneMd5) {
        return new ApiCheckHistoryUserBO(apiKeyPO, phoneMd5);
    }

    public static ApiCheckHistoryUserBO createChannelByMd5(ChannelPO channelPO, String phoneMd5) {
        return new ApiCheckHistoryUserBO(channelPO, phoneMd5);
    }

    public static ApiCheckHistoryUserBO createApiKeyByPhoneMask(ApiKeyPO apiKeyPO, String phoneMask) {
        ApiCheckHistoryUserBO apiCheckHistoryUserBO = new ApiCheckHistoryUserBO(apiKeyPO);
        apiCheckHistoryUserBO.setPhoneMask(phoneMask);
        return apiCheckHistoryUserBO;
    }

    public static ApiCheckHistoryUserBO createChannelByPhoneMask(ChannelPO channelPO, String phoneMask) {
        ApiCheckHistoryUserBO apiCheckHistoryUserBO = new ApiCheckHistoryUserBO(channelPO);
        apiCheckHistoryUserBO.setPhoneMask(phoneMask);
        return apiCheckHistoryUserBO;
    }
}
